/*
day368 
2020.8.30 
*/
#include<iostream>
#include<vector>
using namespace std;

class Solution {
public:
    vector<vector<int>> flipAndInvertImage(vector<vector<int>>& A) {
		int raw_size=A.size(),col_size=A.front().size();
		
		for(int i=0;i<raw_size;++i)
		{
			int l=0,r=col_size-1;
			while(l<r)
			{
				int tem=A[i][l];
				A[i][l]=A[i][r];
				A[i][r]=tem;
				l++;
				r--;
			}
		}
		
		for(int i=0;i<raw_size;++i)
		{
			for(int j=0;j<col_size;++j)
			{
				if(A[i][j]==0)
				{
					A[i][j]=1;
				}
				else
				{
					A[i][j]=0;
				}
			}
		}
		
		return A;
    }
};



int main()
{
	return 0;
 } 
